/*
 * @: 
 * @Version: 1.0
 * @Autor: ziwei
 * @Date: 2021-06-21 15:01:07
 * @LastEditors: ziwei
 * @LastEditTime: 2022-01-25 13:53:02
 */
const path = require('path');
const RunPlugin = require('./plugins/run-plugin');
const DonePlugin = require('./plugins/done-plugin');
module.exports = {
    context:path.resolve(),//代表当前的工作目录 可写可不写
    mode:'productions',
    entry:{
      entry1:'./src/entry1.js',
      entry2:'./src/entry2.js'
    },
    output: {
      path: path.resolve("dist"),
      filename: "[name].js",
    },
    resolve:{
        extensions:['.js','.json','.jsx']
    },
    module:{
        rules:[
            {
                text:/\.js$/,
                use:[
                    path.resolve(__dirname,'loaders/logger1-loader.js'),
                    path.resolve(__dirname,'loaders/logger2-loader.js')
                ]
            }
        ]
    },
    plugins:[
        new RunPlugin(),//开始编译 触发run事件，runPlugin会监听这个事件执行回调
        new DonePlugin(),//编译完成的时候会触发done事件
    ]
}